package com.kai.service.Impl;

import com.kai.dao.CoachMapper;
import com.kai.pojo.Coach;
import com.kai.pojo.dto.CoachDto;
import com.kai.service.CoachService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class CoachServiceImpl implements CoachService {

    @Autowired
    private CoachMapper coachMapper;

    @Override
    public int selectCoachByName(String name) {
        return coachMapper.selectCoachByName(name);
    }

    @Override
    public int selectAllCoachCount(String name, String sex) {
        return coachMapper.selectAllCoachCount(name,sex);
    }

    @Override
    public List<Coach> selectAllCoach(String name, String sex, int i, int pageSize) {
        return coachMapper.selectAllCoach(name,sex,i,pageSize);
    }

    @Override
    public String updateCoachState(String state, String id) {
        return coachMapper.updateCoachState(state,id)+"";
    }

    @Override
    public int updateCoach(CoachDto coach, int value, int value1, int value2) {
        return coachMapper.updateCoach(coach,value,value1,value2);
    }

    @Override
    public int addCoach(CoachDto coach, int value, int value1, int value2) {
        return coachMapper.addCoach(coach,value,value1,value2);
    }

    @Override
    public int deleteCoach(String id) {
        return coachMapper.deleteCoach(id);
    }

    @Override
    public List<Coach> selectCoach() {
        return coachMapper.selectCoach();
    }
}
